package us.wili.dev.platform.jwt;

import us.wili.dev.jwt.model.ChannelEnum;
import us.wili.dev.jwt.model.IUser;

public class JwtUser implements IUser {


    public static final String ADMIN_ID_KEY = "adminId";
    public static final String NAME_KEY = "name";
    public static final String EMAIL_KEY = "email";
    public static final String IF_SUPER_KEY = "ifSuper";
    public static final String ROLE_ID_KEY = "roleId";

    private String uuid;
    private Boolean isAnonymous = true;
    private long expiredSeconds;

    private Long adminId;
    private String name;
    private String email;
    private Boolean ifSuper = false;
    private Long roleId;

    private Long UserId;

    public static String getAdminIdKey() {
        return ADMIN_ID_KEY;
    }

    public static String getNameKey() {
        return NAME_KEY;
    }

    public static String getEmailKey() {
        return EMAIL_KEY;
    }

    public static String getIfSuperKey() {
        return IF_SUPER_KEY;
    }

    public static String getRoleIdKey() {
        return ROLE_ID_KEY;
    }

    public Long getUserId() {
        return UserId;
    }

    public void setUserId(Long userId) {
        UserId = userId;
    }

    @Override
    public String getUuid() {
        return this.uuid;
    }

    @Override
    public Boolean getAnonymous() {
        return this.isAnonymous;
    }

    @Override
    public String getId() {
        return this.isAnonymous ? "uuid:" + this.uuid : String.valueOf(this.adminId);
    }

    @Override
    public Integer getChannel() {
        return ChannelEnum.PC_WEB.getCode();
    }

    @Override
    public String getSubject() {
        return this.name;
    }

    @Override
    public long getExpiredSeconds() {
        return this.expiredSeconds;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }

    public void setAnonymous(Boolean anonymous) {
        isAnonymous = anonymous;
    }

    public void setExpiredSeconds(long expiredSeconds) {
        this.expiredSeconds = expiredSeconds;
    }

    public Long getAdminId() {
        return adminId;
    }

    public void setAdminId(Long adminId) {
        this.adminId = adminId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public Long getRoleId() {
        return roleId;
    }

    public void setRoleId(Long roleId) {
        this.roleId = roleId;
    }

    public Boolean getIfSuper() {
        return ifSuper;
    }

    public void setIfSuper(Boolean ifSuper) {
        this.ifSuper = ifSuper;
    }
}